package com.szxy.miaosha.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @Author: zwz
 * @Date:2020/9/6 21:47
 * @Description:com.szxy.miaosha.utils
 * @Version:1.0
 **/
public class ValidateUtil {

    private static Pattern MOBILE_REX_PATTERN = Pattern.compile("^1\\d{10}");

    /**
     * 校验手机号格式：是否以 1 开头， 11位数字
     *
     * @param mobile
     * @return
     */
    public static boolean validateMobile(String mobile) {
        Matcher matcher = MOBILE_REX_PATTERN.matcher(mobile);
        return matcher.find();
    }

    /**
     * 测试
     * @param args
     */
    public static void main(String[] args) {
        System.out.println(validateMobile("22345678901"));
        System.out.println(CodeMsg.BIND_ERROR.fillArgs("异常信息"));
    }


}
